package com.lw.common.utils

import java.util.regex.Pattern
import java.util.regex.PatternSyntaxException

/**
 * 手机号正则校验
 */
object PhoneUtil {
    @Throws(PatternSyntaxException::class)
    fun isChinaPhoneLegal(str: String?): Boolean {
        val regExp = "^((13[0-9])|(15[^4])|(18[0-9])|(17[0-8])|(147,145))\\d{8}$"
        val p = Pattern.compile(regExp)
        val m = p.matcher(str)
        return m.matches()
    }
}